<script>
	export default {
		onLaunch: function() {
			const {
				statusBarHeight,
				platform
			} = uni.getSystemInfoSync()
			const {
				top,
				height
			} = uni.getMenuButtonBoundingClientRect()
			console.log('App Launch')
			// 状态栏高度
			uni.setStorageSync('statusBarHeight', statusBarHeight)
			// 胶囊按钮高度 一般是32 如果获取不到就使用32
			uni.setStorageSync('menuButtonHeight', height ? height : 32)

			// 判断胶囊按钮信息是否成功获取
			if (top && top !== 0 && height && height !== 0) {
				const navigationBarHeight = (top - statusBarHeight) * 2 + height
				// 导航栏高度
				uni.setStorageSync('navigationBarHeight', navigationBarHeight)
			} else {
				uni.setStorageSync(
					'navigationBarHeight',
					platform === 'android' ? 48 : 40
				)
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import '@/style/common.scss';
	
	view,
	text,
	image,
	page,
	scroll-view,
	swiper,
	swiper-item,
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
		font-family: PingFangSC-Regular, PingFang SC;
	}

	page>view {
		height: 100vh;
		width: 100%;
		overflow-y: auto;
		background-color: #F6F6F6;
	}

	image {
		width: 100%;
		height: 100%;
	}


</style>
